home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 16 / fpc225_3.zip / F-PCHELP.ZIP / COMPAT.TXT < prev    next >
Text File  |  1988-06-04  |  2KB  |  50 lines

  1. COMPAT.TXT      Compatibility problems in F-PC        by Tom Zimmer
  2.  
  3.  
  4.   F-PC is a Forth system which moves the LIST portion of a ":" COLON
  5. definition into another segment.  The technique used in F-PC to
  6. accomplish this causes very few problems with compatibility, but
  7. there are a few, so here are the ones I know about.
  8.  
  9.         EXECUTION ARRAYS
  10.  
  11.   A popular  F83 programming technique for creating a table of
  12. execution vectors is as follows:
  13.  
  14.         CREATE mytable ]
  15.         func0   func1   func2   func3   func4   func5   func6
  16.         func7   func8   func9   func10  [
  17.  
  18.         : domytable     ( n1 --- )
  19.                         2* mytable + PERFORM ;
  20.  
  21.   It works like this, a number n1 is passed to DOMYTABLE, which
  22. causes function number n1 to be performed from the table MYTABLE.
  23.  
  24.   F-PC has a problem with the above technique, as the CREATE creates
  25. MYTABLE in CODE space, and the FUNC's are compiled in LIST space.
  26. That is, in another segment. Since MYTABLE will return an address in
  27. CODE space, DOMYTABLE will misfunction.
  28.  
  29.   To deal with this type of problem, F-PC provides a function called
  30. EXEC: which I obtained from Charles Curley with this definition:
  31.  
  32.         : EXEC:         ( n1 --- )
  33.                         2* R> + XPERFORM ;
  34.  
  35.   EXEC: is used as follows:
  36.  
  37.         : domytable     ( n1 --- )
  38.                         EXEC:
  39.         func0   func1   func2   func3   func4   func5   func6
  40.         func7   func8   func9   func10  ;
  41.  
  42.   I think you will agree that this is a reasonable solution, The word
  43. EXEC: can infact be implimented on a normal F83 system, using PERFORM
  44. instead of XPERFORM, to provide the same functionality with complete
  45. portability of code across systems.  As you can see the definiton
  46. MYTABLE was not even needed, and the definition above is just a
  47. normal COLON definition which can be debugged, decompiled ect.
  48.  
  49.  
  50.